/**
 * @Author: 陈瑞鹏
 * @Date:   2022-10-17 14:24:21
 * @Last Modified by:   陈瑞鹏
 * @Last Modified time: 2022-10-17 14:33:44
 */
import mongoose from 'mongoose';

const Schema = mongoose.Schema;
const HeroSchema: mongoose.Schema = new Schema({
  roleId: { type: Number, desc: '角色Id', index: true },
  level: { type: Number, desc: '等级', default: 1 },
  stepLv: { type: Number, desc: '阶级', default: 0 },
  isGoToWar: { type: Boolean, desc: '是否出战', default: false },
  position: { type: Number, desc: '出战位置', default: -1 },
  id: { type: Number, desc: '武将Id', index: true },
  name: { type: String, desc: '武将名称' },
  extraBonus: { type: Object, desc: '额外加成', default: [0, 0, 0, 0] },
  equipment: { type: Object, desc: '装备', default: ['0', '0', '0', '0', '0', '0'] },
}, { versionKey: false }).index({ roleId: 1, id: 1 }).index({ roleId: 1, isGoToWar: 1 });

const Hero = mongoose.model('Hero', HeroSchema);
export default Hero;